package com.itheima.api;

public class StringBuilderTest {

    // StringBuilder类
    public static void main(String[] args) {
        demo1();
        demo2();
    }


    public static void demo1() {
        StringBuilder stringBuilder = new StringBuilder();
        // 当前容量
        int capacity = stringBuilder.capacity();
        System.out.println(capacity);
    }

    // append & toString
    public static void demo2() {
        StringBuilder hello_world = new StringBuilder("hello world");
        hello_world.append("hello yanweifeng");
        hello_world.append("hello zhangshuling");
        hello_world.append("hello liconcong");
        hello_world.append("hello LBJ");

        System.out.println(hello_world.toString());
    }
}
